package Day2025_03_28;

import java.util.Scanner;

public class Demo06 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        in.nextLine();
        String s = in.nextLine();
        String ss = "shy";
        long[][] dp = new long[n + 1][4];
        for (int i = 0; i <= n; i++) dp[i][0] = 1;
        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= 3; j++) {
                if (s.charAt(i - 1) == ss.charAt(j - 1)) dp[i][j] += dp[i - 1][j - 1];
                dp[i][j] +=dp[i - 1][j];
            }
        }
        System.out.println(dp[n][3]);
    }
}
